<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JavaScript</title>
</head>
<body>
    <script type="text/javascript">
        var num1 = 3;
        var num2 = 5;
        var result = num1 + num2;
        console.log(result);
        var str = '10';
        console.log(num1 + str);
        var result2 = num1 + parseInt(str);
        console.log(result2);
        alert(result2);

        var v;
        console.log(v); //undefined
        console.log(typeof v); //undefined
        v = 3.14;
        console.log(v); //3.14
        console.log(typeof v); //number
        v = 'js';
        console.log(v); //js
        console.log(typeof v); //string
        v = true;
        console.log(v); //true
        console.log(typeof v); //boolean
        v = null;
        console.log(v); //null
        console.log(typeof v); //object

        var m = '3';
        var n = 3;
        if (m == n) {
            console.log('m == n');
        }
        if (m === n) {
            console.log('m === n');
        }

        if(0) {
            console.log("0");
        }
        if(!0) {
            console.log("!0")
        }
        if(1) {
            console.log("1");
        }
        if(!1) {
            console.log("!1");
        }

        var arr = new Array();
        arr.push("zhangsan");
        console.log(arr);
        console.log(arr.length);
        arr.push(true);
        console.log(arr);
        console.log(arr.length);
        arr.push(5);
        console.log(arr);
        console.log(arr.length);
        console.log(arr.pop());
        console.log(arr.pop());
        console.log(arr.pop());

        console.log(eval('3+2'));

        var student = {
            name:'zhangsan',
            age:23,
            study:function () {
                console.log(this.name + '年龄是' + this.age + '岁');
            }
        };
        console.log(student.name);
        student.study();
    </script>
</body>
</html>